<?php

if(!isset($_SESSION['username'])){
		echo "<script>alert('请登录！');window.location.href='index.php?m=admin&c=manage'</script>";die;
	}


	//权限管理
	authonity($con);
	//管理员列表查询  
	// $adminmanage = dbselect($con,'yonghu , permission' , '*' , 'yonghu.per_id = permission .id');

	// assign('adminmanage',$adminmanage);

/*---------------------------------------------------------------------------------------------------------*/
	$p = isset($_GET['p'])?$_GET['p']:1;
	
	
	$num = 5;
	//除去的条数
	$c = ($p-1)*$num;

	$rows = count(dbselect($con,'yonghu'));

	
	// $feild = '*';
	$filed = 'yonghu.username,yonghu.nicheng,yonghu.phone,yonghu.email,yonghu.sex,permission.per_name,yonghu.id,yonghu.status,yonghu.create_time';

	$adminmanage = dbselect($con,'yonghu , permission',$filed,'yonghu.per_id = permission .id',"yonghu.id desc","{$c},{$num}");

	$page = page($con,'yonghu',$p,$rows,$num);

	foreach( $adminmanage as $k => $val){
		$adminmanage[$k]['create_time'] = date("Y-m-d H-m-s",$val['create_time']);
	}

	assign('adminmanage',$adminmanage);

	assign('page',$page);

	$mid = $_GET['mid'];

	$aid = $_GET['aid'];

	
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){

	$list['page'] = $page;

	$list['adminmanage'] = $adminmanage;

	$list['imgsrc'] = IMG;

	$list['mid'] = $mid;

	$list['aid'] = $aid;

	echo json_encode($list);die;
}

	

	
?>